import { ElMessage } from 'element-plus';

/**
 * Shows message content with external package feature.
 * [duration] is in second.
 */
export function showSuccess(msg: string, duration: number = 3000): void {
  ElMessage({
    duration: duration,
    message: msg,
    type: 'success',
  });
}

export function showError(msg: string, duration: number = 3000): void {
  ElMessage({
    duration: duration,
    message: msg,
    type: 'error',
  });
}

export function showWarning(msg: string, duration: number = 3000): void {
  ElMessage({
    duration: duration,
    message: msg,
    type: 'warning',
  });
}
